package com.dj.mingkong.portal.biz.repository.database.system;

import com.dj.mingkong.common.infrastructure.base.dto.query.QueryVo;
import com.dj.mingkong.common.infrastructure.base.repository.BaseDatabaseRepository;
import com.dj.mingkong.common.infrastructure.eo.database.system.UserEo;
import com.dj.mingkong.portal.biz.repository.database.system.mapper.UserMapper;
import org.springframework.stereotype.Repository;


/**
 * 用户repository
 *
 * @author zenglonghui
 * @date: 2022/5/18 10:32
 */
@Repository
public class UserRepository extends BaseDatabaseRepository<UserMapper, UserEo, QueryVo> {
    public boolean existByUsername(String username) {
        return lambdaQuery().eq(UserEo::getUsername, username).exists();
    }

    public UserEo oneByUsername(String username) {
        return lambdaQuery().eq(UserEo::getUsername, username).one();
    }
}
